//
// Created by fei on 9/10/17.
// Copyright (c) 2017 fei. All rights reserved.
//

import UIKit

class BaseViewController:UITableViewController,VisitorLoginViewDelegate {
    var userLogin = false

    var visitorView :VisitorViewController?
    override func loadView() {


    userLogin ? super.loadView() : loadVisitView()


    }


    fileprivate func loadVisitView() {

//
    visitorView = VisitorViewController()
        visitorView?.visitorDelegate = self

        view = visitorView

        self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "注册", style: .plain, target: self, action: "visitorWillRegister")
        self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: "登陆", style: .plain, target: self, action: "visitorWillLogin")

    }

    func visitorWillRegister(){

        print("visitorWillRegister")

    }
    func visitorWillLogin(){

        print("visitorWillLogin")

    }

}
